﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Helpers.Extensions
{
    public static class ListExtensions
    {
        public static void AddIfNotExist<T>(this List<T> list, T item)
        {
            if (list.Contains(item))
                return;
            list.Add(item);
        }

        public static void RemoveIfExist<T>(this List<T> list, T item)
        {
            if (!list.Contains(item))
                return;
            list.Remove(item);
        }
    }
}
